package com.tianlu.store.mapper;
 
import com.tianlu.store.dto.StatusCountDTO;
import com.tianlu.store.dto.TeamPerformanceDTO;
import com.tianlu.store.entity.OrderInfo;
import com.tianlu.store.service.UserInfoService;
import org.apache.ibatis.annotations.Mapper;
import com.tianlu.store.common.MyBaseMapper;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author 梁东烂  
 * @Desc 订单表(OrderInfo)表数据库访问层
 * @Date 2023-04-03 17:06:04
 */
@Mapper
public interface OrderInfoMapper extends MyBaseMapper<OrderInfo> {
    /**
     * 发货14天后自动确认收货
     *
     * @author liangdl
     * @since 2023/4/14 11:33
     */
    List<Long> findAutoConfirmList();

    /**
     * 根据状态统计数量
     *
     * @param userId 用户id
     * @return List<StatusCountDTO>
     */
    List<StatusCountDTO> countByStatus(Long userId);

    /**
     * 查询团队业绩
     *
     * @param userIdList 用户id
     * @return 业绩总额
     * @author liangdl
     * @since 2023/5/4 11:06
     */
    BigDecimal findTeamPerformance(List<Long> userIdList);

    /**
     * 按月查询团队业绩
     *
     * @param userIdList 用户id
     * @return 业绩总额
     * @author liangdl
     * @since 2023/5/4 11:06
     */
    List<TeamPerformanceDTO> findPerformanceDetail(List<Long> userIdList);
}


